/*
	File:				Game.h
	Course:		SGP 1208
	Author:		Kori Po
	Purpose:	Contain / manage the game code
						Manage all of the SGD Wrappers
						Game State Machine
*/

#pragma once

#include <Windows.h>

// SGD Wrappers
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/CSGD_XAudio2.h"

#include "IState.h"

class CGame
{
public:
	// SINGLETON!
	static CGame* GetInstance( void );

		// 3 Actions for any game: Setup, Play, Cleanup
	void Initialize( HWND hWnd, HINSTANCE hInstance,
							int nScreenWidth, int nScreenHeight,
							bool bIsWindowed );

	bool Main( void );

	void Shutdown( void );

	// Screen Info Accessors:
	int		GetScreenWidth	( void ) const	{	return	m_nScreenWidth;		}
	int		GetScreenHeight	( void ) const	{	return	m_nScreenHeight;		}
	bool	GetIsWindowed		( void ) const	{	return	m_bIsWindowed;		}

	// State Machine:
	void	ChangeState( IState* pNewState );

	void	SetIsWindowed	(bool nParam )  {m_bIsWindowed = nParam;};


private:

	// Def Con && Decon
	CGame(void);
	CGame( const CGame& );				// = delete;
	CGame& operator=( const CGame& );	// = delete;
	~CGame( void );						// = default;

	// 3 actions per frame: Input, Update, Render
	bool Input( void );
	void Update( void );
	void Render( void );


	// Screen Info:
	int						m_nScreenWidth;
	int						m_nScreenHeight;
	bool					m_bIsWindowed;

	// SGD Wrappers:
	CSGD_Direct3D*			m_pD3D;
	CSGD_DirectInput*		m_pDI;
	CSGD_TextureManager*	m_pTM;
	CSGD_XAudio2*			m_pXA;

	// Game state:
	IState*				m_pCurrState;

	// Time:
	DWORD					m_dwCurrTime;
};

